package com.api;

import com.activity.bean.AddFaceBean;
import com.activity.bean.AuthBean;
import com.activity.bean.SearchFaceBean;
import com.api.param.LoginParam;
import com.api.param.MobileParam;
import com.api.response.BaseResponse;
import com.api.response.OpusResponse;
import com.api.response.OssResponse;
import com.api.response.RemarkResponse;
import com.api.response.StringResponse;
import com.api.response.UserResponse;


import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

public interface LoginApi {


    /**
     * 获取验证码
     * @param param
     * @return
     */


    @FormUrlEncoded
    @POST("getmessagecode")
    Observable<StringResponse> getMessageCode(@FieldMap Map<String,String> param);

    /**
     * 登录
     * @param param
     * @return
     */


    @FormUrlEncoded
    @POST("login")
    Observable<UserResponse> login(@FieldMap Map<String,String> param);
    @FormUrlEncoded
    @POST("getuserinfobyname")
    Observable<UserResponse> getPersonInfo(@FieldMap Map<String,String> param);
    /**
     * 注册
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("register")
    Observable<UserResponse> register(@FieldMap Map<String,String> param);
    /**
     * 重置密码
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("setnewpassword")
    Observable<StringResponse> setNewpassword(@FieldMap Map<String,String> param);
    /**
     * 作品列表
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("getmyworkslist")
    Observable<OpusResponse> getWorkList(@FieldMap Map<String,String> param);

    @FormUrlEncoded
    @POST("getmyworkslistbycategoryid")
    Observable<OpusResponse> getmyworkslistbycategoryid(@FieldMap Map<String,String> param);
    @FormUrlEncoded
    @POST("getworkslist")
    Observable<OpusResponse> getWorkListHome(@FieldMap Map<String,String> param);
    /**
     * 作品详情
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("getworksinfo")
    Observable<OpusResponse> workDetail(@FieldMap Map<String,String> param);
    /**
     * 评论列表
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("getworksreplylist")
    Observable<RemarkResponse> getWorksReplyList(@FieldMap Map<String,String> param);

    /**
     * 发布作品
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("addworks")
    Observable<StringResponse> addworks(@FieldMap Map<String,String> param);

    @FormUrlEncoded
    @POST("updateworks")
    Observable<StringResponse> updateworks(@FieldMap Map<String,String> param);

    /**
     * oss token
     * @param
     * @return
     */

    @POST("getassumerole")
    Observable<OssResponse> getOss();

    /**
     * 评论
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("addworksreply")
    Observable<StringResponse> addworksreply(@FieldMap Map<String,String> param);
    /**
     * 点赞
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("addworkspraise")
    Observable<StringResponse> addworkspraise(@FieldMap Map<String,String> param);


    @FormUrlEncoded
    @POST("deleteworks")
    Observable<StringResponse> deleteworks(@FieldMap Map<String,String> param);
    /**
     * 修改个人信息
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("updateuserinfo")
    Observable<UserResponse> updateUserinfo(@FieldMap Map<String,String> param);


    /**
     * 重置密码
     * @param param
     * @return
     */

    @FormUrlEncoded
    @POST("resetpassword")
    Observable<StringResponse> resetPassword(@FieldMap Map<String,String> param);


    @POST("token?grant_type=client_credentials&client_id=Yt7DT3SO7LYBubf5bU20K8Gy&client_secret=jT9AulTud67Guy0U31ReCUkziO9vC6Lk")
    Observable<AuthBean> getToken();

    @FormUrlEncoded
    @POST("faceset/user/add")
    Observable<AddFaceBean> addface(@FieldMap Map<String,String> param, @Field("access_token") String token);
    @FormUrlEncoded
    @POST("search")
    Observable<SearchFaceBean> searchFace(@FieldMap Map<String,String> param, @Field("access_token") String token);


}
